/*
 * VoodooCameraInfo.cpp
 *
 *  Created on: Apr 29, 2009
 *      Author: wrice
 */
#include <sstream>
#include "MyVideoTrace.h"
namespace MyVideoTrace {

VoodooCameraInfo::VoodooCameraInfo() {
}

bool VoodooCameraInfo::parseCameraText( string lineToParse ) {
	istringstream iss(lineToParse);

	return !(iss >> Cx_ >> Cy_ >> Cz_ >>
			Ax_ >> Ay_ >> Az_ >>
			Hx_ >> Hy_ >> Hz_ >>
			Vx_ >> Vy_ >> Vz_ >>
			K3_ >> K5_ >>
			sx_ >> sy_ >>
			width_ >> height_ >>
			ppx_ >> ppy_ >>
			f_ >> fov_ >>
			H0x_ >> H0y_ >> H0z_ >>
			V0x_ >> V0y_ >> V0z_).fail();
}

float VoodooCameraInfo::getCameraPositionX() {
	return Cx_;
}
float VoodooCameraInfo::getCameraPositionY() {
	return Cy_;
}
float VoodooCameraInfo::getCameraPositionZ() {
	return Cz_;
}

float VoodooCameraInfo::getCameraAxisX() {
	return Ax_;
}
float VoodooCameraInfo::getCameraAxisY() {
	return Ay_;
}
float VoodooCameraInfo::getCameraAxisZ() {
	return Az_;
}

float VoodooCameraInfo::getCameraHorizonX() {
	return Hx_;
}
float VoodooCameraInfo::getCameraHorizonY() {
	return Hy_;
}
float VoodooCameraInfo::getCameraHorizonZ() {
	return Hz_;
}

float VoodooCameraInfo::getCameraVerticalX() {
	return Vx_;
}
float VoodooCameraInfo::getCameraVerticalY() {
	return Vy_;
}
float VoodooCameraInfo::getCameraVerticalZ() {
	return Vz_;
}

float VoodooCameraInfo::getRadialDistortionK3() {
	return K3_;
}
float VoodooCameraInfo::getRadialDistortionK5() {
	return K5_;
}

float VoodooCameraInfo::getPixelSizeX() {
	return sx_;
}
float VoodooCameraInfo::getPixelSizeY() {
	return sy_;
}

int VoodooCameraInfo::getImageSizeWidth() {
	return width_;
}
int VoodooCameraInfo::getImageSizeHeight() {
	return height_;
}

float VoodooCameraInfo::getPrincipalPointOffsetX() {
	return ppx_;
}
float VoodooCameraInfo::getPrincipalPointOffsetY() {
	return ppy_;
}

float VoodooCameraInfo::getForcalLength() {
	return f_;
}

float VoodooCameraInfo::getHorizontalFieldOfView() {
	return fov_;
}

float VoodooCameraInfo::getRotationAxis0X() {
	return H0x_;
}
float VoodooCameraInfo::getRotationAxis0Y() {
	return H0y_;
}
float VoodooCameraInfo::getRotationAxis0Z() {
	return H0z_;
}

float VoodooCameraInfo::getRotationAxis1X() {
	return V0x_;
}
float VoodooCameraInfo::getRotationAxis1Y() {
	return V0y_;
}
float VoodooCameraInfo::getRotationAxis1Z() {
	return V0z_;
}

Vector3f VoodooCameraInfo::getCameraPosition() {
	return 	Vector3f(getCameraPositionX(), getCameraPositionY(), getCameraPositionZ());
}

Vector3f VoodooCameraInfo::getCameraAxis() {
	return 	Vector3f(getCameraAxisX(), getCameraAxisY(), getCameraAxisZ());
}

Vector3f VoodooCameraInfo::getCameraHorizon() {
	return 	Vector3f(getCameraHorizonX(), getCameraHorizonY(), getCameraHorizonZ());
}

Vector3f VoodooCameraInfo::getCameraVertical() {
	return 	Vector3f(getCameraVerticalX(), getCameraVerticalY(), getCameraVerticalZ());
}

Vector3f VoodooCameraInfo::getRotationAxis0() {
	return 	Vector3f(getRotationAxis0X(), getRotationAxis0Y(), getRotationAxis0Z());
}

Vector3f VoodooCameraInfo::getRotationAxis1() {
	return 	Vector3f(getRotationAxis1X(), getRotationAxis1Y(), getRotationAxis1Z());
}


}
